﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmOrganizacion.aspx.cs" Inherits="ddcCajamarca.Web.Directorio.frmOrganizacion" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="container">
        <div class="row">
            <div class="col-lg-9 col-xs-12">
                <h2>
                    <asp:Label ID="lbTitulo" Text="Editar Persona" runat="server" /></h2>
                <div class="row">
                    <div class="col-md-5">
                        <label>
                            <asp:Label ID="lbId" Text="Id" runat="server" /></label>
                        <asp:TextBox ID="txtId" CssClass="form-control input-sm" runat="server" ReadOnly="true" /><br />
                        <label>Nombre*:</label>
                        <asp:TextBox ID="txtNombre" CssClass="form-control input-sm" runat="server" MaxLength="100"
                            placeholder="Ej: Dirección Desconcentrada de Cultura" /><br />
                        <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender5" targetcontrolid="txtNombre" filtertype="Numbers, UppercaseLetters, LowercaseLetters, Custom" validchars=". áéíóú ÁÉÍÓÚ" runat="server"></ajaxtoolkit:filteredtextboxextender>
                        <label>Ruc*:</label>
                        <asp:TextBox ID="txtRuc" CssClass="form-control input-sm" runat="server" MaxLength="11"
                            placeholder="Ej: 10731367014" /><br />
                        <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender4" targetcontrolid="txtRuc" filtertype="Numbers" runat="server"></ajaxtoolkit:filteredtextboxextender>
                        <label>Istitución Vinculada:</label>
                        <asp:DropDownList ID="ddlInstVinculada" runat="server"
                            ItemType="ddcCajamarca.BusinessEntities.Directorio.Organizacion"
                            SelectMethod="GetOrganizacionesLista"
                            DataTextField="Nombre"
                            DataValueField="Id"
                            CssClass="form-control input-sm" /><br />
                        <label>Dirección:</label>
                        <asp:TextBox ID="txtDireccion" CssClass="form-control input-sm" runat="server" MaxLength="50"
                            placeholder="Ej: Jr. Belén 159" /><br />
                        <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender9" targetcontrolid="txtDireccion" filtertype="Numbers, UppercaseLetters, LowercaseLetters, Custom" validchars=". áéíóú ÁÉÍÓÚ" runat="server"></ajaxtoolkit:filteredtextboxextender>
                        <label>Ciudad:</label>
                        <asp:DropDownList ID="ddlUbigeo" runat="server"
                            ItemType="ddcCajamarca.BusinessEntities.Directorio.Ubigeo"
                            SelectMethod="GetUbigeos"
                            DataTextField="Nombre"
                            DataValueField="Id"
                            CssClass="form-control input-sm" />
                    </div>
                    <div class="col-md-5">
                        <br />
                        <div class="row">
                            <div class="col-lg-6">
                                <label>Telefono 1*:</label>
                                <asp:TextBox ID="txtTelefono" CssClass="form-control input-sm" runat="server" MaxLength="10"
                                    placeholder="Ej: 990212662" />
                                <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender7" targetcontrolid="txtTelefono" filtertype="Numbers, Custom" validchars="#*" runat="server"></ajaxtoolkit:filteredtextboxextender>
                            </div>
                            <div class="col-lg-6">
                                <label>Telefono 2:</label>
                                <asp:TextBox ID="txtTelefono2" CssClass="form-control input-sm" runat="server" MaxLength="10"
                                    placeholder="Ej: 990212662" />
                                <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender8" targetcontrolid="txtTelefono2" filtertype="Numbers, Custom" validchars="#*" runat="server"></ajaxtoolkit:filteredtextboxextender>
                            </div>
                        </div>
                        <br />
                        <label>Email:</label>
                        <asp:TextBox ID="txtEmail" CssClass="form-control input-sm" runat="server" MaxLength="100"
                            placeholder="Ej: jhrpierd@hotmail.es" /><br />
                        <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender6" targetcontrolid="txtEmail" filtertype="Numbers, LowercaseLetters, Custom" validchars=".@" runat="server"></ajaxtoolkit:filteredtextboxextender>
                        <label>Pagina Web:</label>
                        <asp:TextBox ID="txtPaginaWeb" CssClass="form-control input-sm" runat="server" MaxLength="100"
                            placeholder="Ej: http://mipagina.com.org, https://www.facebook.com/myfacebook, ..." /><br />
                        <label>Imagen</label>
                        <asp:FileUpload ID="fuImagen" CssClass="form-control" runat="server" />
                        *Usar Nombre de la Empresa Para el Nombre del Logo
                    </div>
                    <div class="col-md-2">
                        <asp:Image ID="idImg" Width="250px" Height="250px" runat="server" />
                    </div>
                    <br />
                </div>
                <br />

                <!-- Detalle Tipo Organización -->

                <h3>Tipo Organización</h3>
                <div class="row">
                    <div class="col-lg-2">
                        <label class="control-label">Tipo:  </label>
                        <br />
                        <br />
                        <label class="control-label">SubTipo:  </label>
                        <br />
                        <br />
                        <label class="control-label">Infraestructura:  </label>
                    </div>
                    <div class="col-lg-5">
                        <asp:DropDownList ID="ddlTipoOrganizacion" runat="server"
                            ItemType="ddcCajamarca.BusinessEntities.Directorio.TipoOrganizacion"
                            SelectMethod="GetOrganizaciones"
                            DataTextField="Nombre"
                            DataValueField="Id"
                            CssClass="form-control input-sm" AutoPostBack="True" OnSelectedIndexChanged="ddlTipoOrganizacion_SelectedIndexChanged" /><br />

                        <asp:DropDownList ID="ddlSubTipoOrganizacion" runat="server"
                            ItemType="ddcCajamarca.BusinessEntities.Directorio.SubTipoInstitucion"
                            DataTextField="Nombre"
                            DataValueField="Id"
                            CssClass="form-control input-sm"
                            Enabled="false" /><br />

                        <asp:TextBox ID="txtAmbiente" Text="" runat="server" Enabled="false" Width="100%" />

                    </div>
                    <div class="col-lg-3">
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <asp:Button Text="Agregar" runat="server" ID="btnAgregar" CssClass="btn btn-info" OnClick="btnAgregar_Click" Enabled="true" />
                    </div>
                </div>

                <div class="row">
                    <div class="col-lg-12 col-md-8 col-xs-12 col-sm-8">
                        <asp:UpdatePanel ID="updetInfra" runat="server">
                            <ContentTemplate>
                                <asp:ListView ID="lvDetalleInfra" runat="server" OnItemCommand="lvDetalleInfra_ItemCommand">
                                    <EmptyDataTemplate>
                                        <tr>
                                            <td colspan="4">
                                                <h5>No se ha agregado infraestructura.!!</h5>
                                            </td>
                                        </tr>
                                    </EmptyDataTemplate>
                                    <LayoutTemplate>
                                        <table class="table table-striped table-responsive">
                                            <thead>
                                                <tr>
                                                    <th colspan="2">Ambiente</th>
                                                    <th colspan="1">Butacas</th>
                                                    <th colspan="1">Pie</th>
                                                    <th colspan="1">Graderias</th>
                                                    <th colspan="1">EquiposVisuales</th>
                                                    <th colspan="1">EquiposAudio</th>
                                                    <th colspan="1">Acciones</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr id="itemPlaceholder" runat="server" />
                                            </tbody>
                                            <tfoot>
                                                <tr>
                                                    <td colspan="3">
                                                        <asp:Button ID="btnActualizar" runat="server"
                                                            Text="Actualizar"
                                                            CommandName="updateActualizar"
                                                            CssClass="btn btn-info" /></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                </tr>
                                            </tfoot>
                                        </table>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label ID="lbambiente" Text="<%# Bind('Ambientte') %>" runat="server" /></td>
                                            <td colspan="1">
                                                <asp:TextBox ID="txtButacas" Text="<%# Bind('Butacas') %>" runat="server" Width="50px" /></td>
                                            <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender1" targetcontrolid="txtButacas" filtertype="Numbers" runat="server"></ajaxtoolkit:filteredtextboxextender>
                                            <td colspan="1">
                                                <asp:TextBox ID="txtPie" Text="<%# Bind('Pie') %>" runat="server" Width="50px" /></td>
                                            <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender2" targetcontrolid="txtPie" filtertype="Numbers" runat="server"></ajaxtoolkit:filteredtextboxextender>
                                            <td colspan="1">
                                                <asp:TextBox ID="txtGraderias" Text="<%# Bind('Graderias') %>" runat="server" Width="50px" /></td>
                                            <ajaxtoolkit:filteredtextboxextender id="FilteredTextBoxExtender3" targetcontrolid="txtGraderias" filtertype="Numbers" runat="server"></ajaxtoolkit:filteredtextboxextender>
                                            <td colspan="1">
                                                <asp:TextBox ID="txtEquiposVisuales" Text="<%# Bind('EquiposVisuales') %>" placeholder="Ej: Proyector, ..." runat="server" /></td>
                                            <td colspan="1">
                                                <asp:TextBox ID="txtEquiposAudio" Text="<%# Bind('EquiposAudio') %>" placeholder="Ej: Parlantes, ..." runat="server" /></td>
                                            <td colspan="1">
                                                <asp:Button ID="btnQuitar"
                                                    Text="Quitar"
                                                    runat="server"
                                                    CssClass="btn btn-danger"
                                                    CommandName="QuitarInfraestructura"
                                                    CommandArgument='<%# Eval("Ambientte") %>' />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:ListView>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="btnAgregar" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="lvDetalleInfra" EventName="ItemCommand" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </div>
                </div>

                <div class="row">
                    <div class="col-lg-12">
                        <asp:Button ID="btnGuardar" CssClass="btn btn-success" Text="Guardar" runat="server" OnClick="btnGuardar_Click" />
                        <a href="frmListOrganizacion.aspx" class="btn btn-danger" style="color: #ffffff;">Cancelar</a>
                        <div class="bg-danger">
                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtNombre" Text="*"
                                Display="Dynamic" Type="String" Operator="DataTypeCheck" ErrorMessage="CompareValidator"> </asp:CompareValidator>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
